/* 5.20 Nested Loops
 */
#include <stdio.h>
#define NUMSTUDENTS 20
#define NUMGRADES 4

int main()
{
    int i, j;
    float grade, total, average;

    for (i = 1; i <=NUMSTUDENTS; i++)
    {
        total = 0;

        for (j = 1; j <= NUMGRADES; j++)
        {
            printf("Enter an examination grade for this student %d: ",i);
            scanf("%f", &grade);
            total += grade;
        }

        average = total / NUMGRADES;
        printf("\nThe average for student %d is %f\n\n", i, average);
    }

    return 0;
}